<%= form_for (@path) do |f| %>
  <% if @vote.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@vote.errors.count, "error") %> prohibited this vote from being saved:</h2>

      <ul>
      <% @vote.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  <% if isreviewer? %>
  <span id="votingInfoTitle" class="subHead expand">Voting Information</span><span class="help">(Click title to show or hide this group)</span>
  <div class="subGroup" id="votingInfo">
  <br>
  <div class="subLabel">
    <span>Vote</span>
    <%= f.select :vote,[["Accept","A"],["Reject","R"]]  %>
  </div>
  <br>
  <div class="subLabel">
    <span style="position:relative; bottom:40px;">Comments</span>
    <%= f.text_area :comments, :rows => "5", :cols => "35" %>
  </div>
  <br><br>
  <!-- admin notes to voters -->
  <div class="subLabel">
  <span>Region</span>
  <%= @submission.region %>
  </div>
  <br>
  <div class="subLabel">
  <span>Category of Acceptance</span>
  <%= @submission.s_degree %>
  </div>
  <br>
  <div class="subLabel">
  <span class="subLabel"> Administrator Notes </span>
  <p style="color:white;font-size:14pt;"><%= @submission.admin_notes %></p>
  </div>
  </div>
  <!-- Print out old comments on this vote! -->
  <br>
  <!-- span style="font-size:14pt;">Past Voting Information</span -->
  <% while @submission.rounds != nil && @count <= @submission.rounds  %>
	<% @acount = 0 %>
	<% @rcount = 0 %>
	<% if @oldRecords %>
		<% if @count!= @submission.rounds %>
		<br><br>
		<% @oldRecords.each do |r| %>
			<% if r.round == @count%>
				<% @acount += 1 if r.vote == "A" %>
				<% @rcount += 1 if r.vote == "R" %>
			<% end %>
		<% end %>
		<span onclick="$(this).next('div').toggle();"  class="subHead"> Round <%= @count %> Information - <%= @acount %> A <span class ="no"><%= @rcount %> R</span></span>
		<div class="" style="border: #4e82c8 2px solid;padding: 5px;font-size:14pt;border-radius: 0px 10px 10px 10px;">
		<% @oldRecords.each do |r| %>
			<% if r.round == @count%>
				<div>
					<br>
					<%= r.voter_name %> voted to <%if r.vote == "A" %> Accept <% else %> Reject <% end %> on on <%= r.vote_time.strftime("%m/%d/%y  %I:%M%p") %> 
					<br>
					<% if r.comment != "" %>
					Comment made by <%= r.voter_name %> :
					<br>
					<p>
						<%= r.comment %>
					</p>
					<% end %>
				</div>
			<% end %>
			<% end %>
		</div>
		<% end %>
	<% end %>
	<% @count += 1 %>
  <% end %>
  <br><br>
  <div class="actions">
  	<%= f.submit "Save Comments",:class => "btn-custom" %>

    <%= f.submit "Make Vote", :class=>"btn-custom" %>
  </div>
  <% end %>
<% end %>
